<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../../js/CHN.js"></script>
		<script src="../../js/ENG.js"></script>
		<script src="../../js/jquery-2.2.3.min.js"></script>
		<link rel="stylesheet" href="../../css/homepage.css" />
	</head>

	<body>
		<div id="all">
			<div id="header">
				<a id="logoA" href="1homepage.html">
					<div id="logo"></div>
				</a>
				<div id="language">
					<span id="country">中国</span>
					<select name="" onchange="traditional(this)">
						<option value="Select Language">Select Language</option>
						<option value="English">English</option>
						<option value="Chinese">Chinese</option>
					</select>
					<span class="right">|</span>
					<a href="http://www.subway.com/en-us">进入全球官网</a>
				</div>
				<ul id="head">
					<a href="2news.html">
						<li>新闻动态<img src="../../img/menu_part.gif" /></li>
					</a>
					<a href="3foodMenu.html">
						<li id="down_text1"><span id="down_text11">美食与营养</span><img src="../../img/menu_part.gif" />
							<ul id="down_text">
								<a href="3foodMenu.html">
									<li>超值 Value</li>
								</a>
								<a href="3foodMenu.html">
									<li>经典 ClassIcs</li>
								</a>
								<a href="3foodMenu.html">
									<li>精选 Premlum</li>
								</a>
								<a href="3foodMenu.html">
									<li>低脂 Low Fat</li>
								</a>
								<a href="3foodMenu.html">
									<li>百味卷 Wrap</li>
								</a>
								<a href="3foodMenu.html">
									<li>沙拉 Salad</li>
								</a>
								<a href="3foodMenu.html">
									<li>聚餐服务 CaterIng</li>
								</a>
								<a href="3foodMenu.html">
									<li>饮料与小食 Drinks & Sldes</li>
								</a>
								<a href="3foodMenu.html">
									<li>早餐 BREAKFAST</li>
								</a>
								<a href="3foodMenu.html">
									<li>营养 NutritIon</li>
								</a>
								<a href="3foodMenu.html">
									<li>如何点餐 How TO Order</li>
								</a>
							</ul>
						</li>
					</a>
					<a href="4joinUs.html">
						<li>加盟流程<img src="../../img/menu_part.gif" /></li>
					</a>
					<a href="5aboutUs.html">
						<li>关于我们</li>
					</a>
					<a href="###" id="lastLi">
						<li>快餐店位置查询</li>
					</a>
				</ul>
			</div>

			<div id="imgSlider">
				<div id="slider1"></div>
				<div id="slider2"></div>
				<a href=""><img id="imgSlider1" src="../../img/0C21FF01B629A0B77586FE5322F3AE59.jpg" /></a>
				<a href=""><img src="../../img/55F0A94375FD169AB61C276D24C8E68F.jpg" /></a>
			</div>

			<div id="rightImg">
				<img class="bg" src="../../img/tbg1.png" />
				<img class="bg" src="../../img/tbg2.png" />
				<img class="bg" src="../../img/tbg3.png" />
				<img class="mi" src="../../img/w1.png" />
				<img class="mi" src="../../img/w2.png" />
				<img class="mi" src="../../img/w3.png" />
				<img class="te" src="../../img/t1.png" />
				<img class="te" src="../../img/t2.png" />
				<img class="te" src="../../img/t3.png" />
			</div>
			<img id="erWei" src="../../img/F446097651218DD6122798254106BDE6.png"/>
			<div id="foot">
				<a href="6position.html"><img src="../../img/home-box-1_CN.jpg" /></a>
				<a href="3foodMenu.html"><img src="../../img/home-box-2_CN.jpg" /></a>
				<a href="2news.html"><img src="../../img/home-box-3_CN.jpg" /></a>
				<a id="footImg" href="http://weibo.com/"><img src="../../img/weibo_CN.jpg" /></a>
				<a id="footImg1" href="###"><img src="../../img/weixin_CN.jpg" /></a>
			</div>
			<p id="footer">
				<a href="###">主页 |</a>
				<a href="###">菜单/营养 |</a>
				<a href="###">如何加盟 |</a>
				<a href="###">关于我们 |</a>
				<a href="###">快餐店位置查询</a>
				<br />
				<a href="###">联系我们 |</a>
				<a href="###">使用条款 |</a>
				<a href="###">隐私权政策 |</a>
				<a href="###">SUBWAY Partners™</a>
			</p>
			<div id="footer1">
				<p>SUBWAY® is a Registered Trademark of Subway IP Inc.</p>
				<p>®2016 Subway IP Inc.</p>
			</div>
		</div>
	</body>
	<script>
		// 左边轮播图
		$("#imgSlider>div").eq(0).html("<");
		$("#imgSlider>div").eq(1).html(">");
		$("#imgSlider").hover(function() {
			$("#imgSlider>div").css({
				display: "block"
			})
		}, function() {
			$("#imgSlider>div").css({
				display: "none"
			})
		})

		function autoImg(n) {
			var index = n;
			var t = setInterval(function() {
				$("#imgSlider>a>img").eq(index).animate({
					opacity: 0,
					zIndex: 0
				}, 1000, function() {
					$("#imgSlider>a>img").eq(1 - index).css({
						zIndex: 100
					})
					$("#imgSlider>a>img").eq(index).css({
						opacity: 1
					})
				})
				index--;
				if(index < 0) {
					index = 1;
				}
			}, 8000)
		}
		autoImg(1);

		// 轮播图点击切换
		function click() {
			var imgArr = document.querySelectorAll("#imgSlider>a>img");
			var divArr = document.querySelectorAll("#imgSlider>div");
			for(var i = 0; i < divArr.length; i++) {
				divArr[i].onclick = function() {
					if(imgArr[0].style.opacity == 0) {
						imgArr[0].style.opacity = 1;
						imgArr[1].style.opacity = 0;
					} else {
						imgArr[1].style.opacity = 1;
						imgArr[0].style.opacity = 0;
					}
				}
			}
		}
		click();

		// 下拉菜单
		function select() {
			var down_text = document.getElementById("down_text1");
			var thisChildren = down_text.children;
			down_text.onmouseover = function() {
				thisChildren[1].style.display = "block";
			}
			down_text.onmouseout = function() {
				thisChildren[1].style.display = "none";
			}
			
		}
		select();

		//右面轮播图
		function rightImg() {
			var imgArr = ["url(../../img/pic1.jpg)", "url(../../img/pic2.jpg)", "url(../../img/pic3.jpg)"];
			var rightDiv = document.getElementById("rightImg");
			var i = 0;
			setInterval(function() {
				$(".bg").eq(i).animate({
					top: 0
				}, 1000, Fn)
			}, 8000);

			function Fn() {
				$(".te").eq(i).animate({
					left: 0
				}, 1000, Fh)
			}

			function Fh() {
				$(".mi").eq(i).animate({
					left: 0
				}, 1000, Fg)
			}

			function Fg() {
				$(".te").eq(i).animate({
					left: 288
				}, 1000, Fi)
			}

			function Fi() {
				$(".te").eq(i).css({
					left: -288
				})
				$(".mi").eq(i).animate({
					left: 288
				}, 1000, Fb)
			}

			function Fb() {
				$(".mi").eq(i).css({
					left: -288
				})
				$(".bg").eq(i).animate({
					top: -156
				}, 1000, Fs)
			}

			function Fs() {
				$("#rightImg").animate({
					opacity: 0
				}, 1000, Fq)
			}

			function Fq() {
				i++;
				if(i > 2) {
					i = 0;
				}
				$("#rightImg").css({
					opacity: 1,
				})
				rightDiv.style.background = imgArr[i];
			}
		}
		rightImg();

		// 二维码
		function erWeiMa(){
			$("#footImg1").hover(function(){
				$("#erWei").css({
					display:"block"
				})
			},function(){
				$("#erWei").css({
					display:"none"
				})
			})
		}
		erWeiMa();
		
		// 下边图触发变色
		function hover(){
			var footImg = document.querySelectorAll("#foot>a>img")
			$("#foot>a>img").eq(0).hover(function(){
					footImg[0].src = "../../img/0441C3D1C41D58A11581CF0B7C4E718D.jpg"
				},function(){
					footImg[0].src = "../../img/home-box-1_CN.jpg";
				})
				$("#foot>a>img").eq(1).hover(function(){
					footImg[1].src = "../../img/F381A46663B3CB1495F9F23B9C5EB276.jpg"
				},function(){
					footImg[1].src = "../../img/home-box-2_CN.jpg";
				})
				$("#foot>a>img").eq(2).hover(function(){
					footImg[2].src = "../../img/95EB54105742D4D767334A3B99569ADC.jpg"
				},function(){
					footImg[2].src = "../../img/home-box-3_CN.jpg";
				})
				$("#foot>a>img").eq(3).hover(function(){
					footImg[3].src = "../../img/weibo_CN_hover副本.jpg"
				},function(){
					footImg[3].src = "../../img/weibo_CN.jpg"
				})
				$("#foot>a>img").eq(4).hover(function(){
					footImg[4].src = "../../img/weixin_CN_hover副本.jpg"
				},function(){
					footImg[4].src = "../../img/weixin_CN.jpg"
				})
		}
		hover();
		
		// 下边图英文版变色
		function EnHover(){
			var footImg = document.querySelectorAll("#foot>a>img")
			$("#foot>a>img").eq(0).hover(function(){
					footImg[0].src = "../../img/CD7D740FD76BFEC60748AA02BDC63954.jpg"
				},function(){
					footImg[0].src = "../../img/home-box-1_EN.jpg";
				})
				$("#foot>a>img").eq(1).hover(function(){
					footImg[1].src = "../../img/140EB629FBB24A9396A1F3EFAF55FAB1.jpg"
				},function(){
					footImg[1].src = "../../img/home-box-2_EN.jpg";
				})
				$("#foot>a>img").eq(2).hover(function(){
					footImg[2].src = "../../img/958E2D1BD2D2773E01A7FA00FA34F26D.jpg"
				},function(){
					footImg[2].src = "../../img/home-box-3_EN.jpg";
				})
				$("#foot>a>img").eq(3).hover(function(){
					footImg[3].src = "../../img/weibo_EN_hover副本.jpg"
				},function(){
					footImg[3].src = "../../img/weibo_EN.jpg"
				})
				$("#foot>a>img").eq(4).hover(function(){
					footImg[4].src = "../../img/weixin_EN_hover副本.jpg"
				},function(){
					footImg[4].src = "../../img/weixin_EN.jpg"
				})
		}
		
		// 国际化
		function traditional(value){
			var x = value.options[value.selectedIndex];
			var footImg = document.querySelectorAll("#foot>a>img");
			if(x.value == "English"){
				document.getElementById("country").innerHTML = ENGObj.country;
				document.querySelector("#language>a").innerHTML = ENGObj.worldWidle;
				document.querySelectorAll("#head>a>li")[0].innerHTML = ENGObj.navOne;
				document.getElementById("down_text11").innerHTML = ENGObj.navTwo;
				document.querySelectorAll("#head>a>li")[1].innerHTML = ENGObj.navThree;
				document.querySelectorAll("#head>a>li")[2].innerHTML = ENGObj.navFour;
				document.querySelectorAll("#head>a>li")[3].innerHTML = ENGObj.navFive;
				document.querySelectorAll("#down_text>a>li")[0].innerHTML = ENGObj.navTwoFirst;
				document.querySelectorAll("#down_text>a>li")[1].innerHTML = ENGObj.navTwoSecond;
				document.querySelectorAll("#down_text>a>li")[2].innerHTML = ENGObj.navTwoThrid;
				document.querySelectorAll("#down_text>a>li")[3].innerHTML = ENGObj.navTwoForth;
				document.querySelectorAll("#down_text>a>li")[4].innerHTML = ENGObj.navTwoFifth;
				document.querySelectorAll("#down_text>a>li")[5].innerHTML = ENGObj.navTwoSixth;
				document.querySelectorAll("#down_text>a>li")[6].innerHTML = ENGObj.navTwoSeventh;
				document.querySelectorAll("#down_text>a>li")[7].innerHTML = ENGObj.navTwoEighth;
				document.querySelectorAll("#down_text>a>li")[8].innerHTML = ENGObj.navTwoNinth;
				document.querySelectorAll("#down_text>a>li")[9].innerHTML = ENGObj.navTwoTenth;
				document.querySelectorAll("#down_text>a>li")[10].innerHTML = ENGObj.navTwoEleventh;	
				document.querySelectorAll(".mi")[0].src = "../../img/w2e.png";
				document.querySelectorAll(".mi")[1].src = "../../img/w2e.png";
				document.querySelectorAll(".mi")[2].src = "../../img/w2e.png";
				document.querySelectorAll(".te")[0].src = "../../img/t2e.png";
				document.querySelectorAll(".te")[1].src = "../../img/t2e.png";
				document.querySelectorAll(".te")[2].src = "../../img/t2e.png";
				footImg[0].src = "../../img/home-box-1_EN.jpg";
				footImg[1].src = "../../img/home-box-2_EN.jpg";
				footImg[2].src = "../../img/home-box-3_EN.jpg";
				footImg[3].src = "../../img/weibo_EN.jpg"
				footImg[4].src = "../../img/weixin_EN.jpg"
				EnHover();
			}else{
				document.getElementById("country").innerHTML = CHNObj.country;
				document.querySelector("#language>a").innerHTML = CHNObj.worldWidle;
				document.querySelectorAll("#head>a>li")[0].innerHTML = CHNObj.navOne;
				document.getElementById("down_text11").innerHTML = CHNObj.navTwo;
				document.querySelectorAll("#head>a>li")[1].innerHTML = CHNObj.navThree;
				document.querySelectorAll("#head>a>li")[2].innerHTML = CHNObj.navFour;
				document.querySelectorAll("#head>a>li")[3].innerHTML = CHNObj.navFive;
				document.querySelectorAll("#down_text>a>li")[0].innerHTML = CHNObj.navTwoFirst;
				document.querySelectorAll("#down_text>a>li")[1].innerHTML = CHNObj.navTwoSecond;
				document.querySelectorAll("#down_text>a>li")[2].innerHTML = CHNObj.navTwoThrid;
				document.querySelectorAll("#down_text>a>li")[3].innerHTML = CHNObj.navTwoForth;
				document.querySelectorAll("#down_text>a>li")[4].innerHTML = CHNObj.navTwoFifth;
				document.querySelectorAll("#down_text>a>li")[5].innerHTML = CHNObj.navTwoSixth;
				document.querySelectorAll("#down_text>a>li")[6].innerHTML = CHNObj.navTwoSeventh;
				document.querySelectorAll("#down_text>a>li")[7].innerHTML = CHNObj.navTwoEighth;
				document.querySelectorAll("#down_text>a>li")[8].innerHTML = CHNObj.navTwoNinth;
				document.querySelectorAll("#down_text>a>li")[9].innerHTML = CHNObj.navTwoTenth;
				document.querySelectorAll("#down_text>a>li")[10].innerHTML = CHNObj.navTwoEleventh;	
				footImg[0].src = "../../img/home-box-1_CN.jpg";
				footImg[1].src = "../../img/home-box-2_CN.jpg";
				footImg[2].src = "../../img/home-box-3_CN.jpg";
				footImg[3].src = "../../img/weibo_CN.jpg"
				footImg[4].src = "../../img/weixin_CN.jpg"
				document.querySelectorAll(".mi")[0].src = "../../img/w1.png";
				document.querySelectorAll(".mi")[1].src = "../../img/w2.png";
				document.querySelectorAll(".mi")[2].src = "../../img/w3.png";
				document.querySelectorAll(".te")[0].src = "../../img/t1.png";
				document.querySelectorAll(".te")[1].src = "../../img/t2.png";
				document.querySelectorAll(".te")[2].src = "../../img/t3.png";
				hover();
			}
		}
		
		
	</script>

</html>